package com.binguo.wxapi.service;


import com.binguo.common.exception.ErrorCode;
import com.binguo.model.api.vo.BinguoOrderVO;
import com.binguo.model.model.*;
import com.binguo.model.wxapi.form.ZSDOrderInfoForm;
import com.binguo.model.wxapi.form.ZSDWXGongZhongMessageForm;
import com.binguo.model.wxapi.vo.AiyouweiGetCellVO;
import com.binguo.model.wxapi.vo.OpenCellByCardNoVO;
import com.binguo.model.wxapi.vo.SideBoardVO;
import com.binguo.wxapi.form.PhoneMealsForm;
import com.binguo.wxapi.form.aiyouwei.BindCustomerBoardForm;
import com.binguo.wxapi.form.aiyouwei.SaveOrderForm;

import java.text.ParseException;
import java.util.List;



public interface AiyouweiTestService {
    /**
     * 查询分店是否设置了加热和存餐费用
     * @param sideBoardVO
     * @return SideBoardVO  ： null
     */
    SideBoardVO getIsWramAndIsMeals(SideBoardVO sideBoardVO);

    /**
     * 新增取餐柜加热和存餐费用记录设置
     * @param sideBoardVO shopId : branchId : warm : price
     * @return Integer i > 0 成功  < = 0 失败
     */
    Integer addShopConfigExtend(SideBoardVO sideBoardVO);

    /**
     * 更新取餐柜存餐和费用记录
     * @param sideBoardVO  id : warm : price
     * @return Integer i > 0 成功  < = 0 失败
     */
    Integer updateShopConfigExtend(SideBoardVO sideBoardVO);

    /**
     * 查询某个订单的存餐和取餐费用
     * @param binguoOrderVO
     * @return SideBoardVO  ： null
     */
    SideBoardVO getOrderSideBoardVO(BinguoOrderVO binguoOrderVO,String orderId);

    /**
     * 获取订单详细页面二维码
     * @param saveOrderForm
     * @return String
     */
    String getQrCode(SaveOrderForm saveOrderForm);

    /**
     * 存餐码存餐
     * @param saveOrderForm
     * @return true : false
     */
    ErrorCode saveOrderByMealCode(SaveOrderForm saveOrderForm);

    /**
     * 取餐码取餐
     * @param saveOrderForm
     * @return true : false
     */
    ErrorCode getOrderByMealCode(SaveOrderForm saveOrderForm) throws Exception;

    /**
     * 获取订单id
     * @param mealCode 取餐码
     * @param shopId 商户Id
     * @param branchId 分店id
     * @return String
     */
    String getBinguoOrderId(String mealCode,Integer shopId,Integer branchId);

    BinguoOrderVO getBinguoOrderByOrderNo(String OrderNo);

    /**
     * 查找出一个当前分店下的空闲取餐柜
     * @param branchId 分店ID
     * @param shopId 商户ID
     * @return AiyouweiGetCellVO
     */
    AiyouweiGetCellVO selectAllNotUseCell(Integer branchId, Integer shopId);

    /**
     * 根据id查找出对应的柜子
     * @param id
     * @return sideboard
     */
    SideBoard getSideBoardById(Integer id);

    /**
     * 根据订单号查找取餐码
     * @param orderNo
     * @return mealCode
     */
    String isMealCodeExist(String orderNo,Integer shopId,Integer branchId);

    /**
     * 在当前分店下生成唯一取餐码
     * @param branchId
     * @return mealCode
     */
    String getMealCode(Integer branchId);

    /**
     * 发送极光推送信息
     * @param binguoOrderVO
     * @param sideBoard
     * @return true : false
     */
    Boolean sendJpush(BinguoOrderVO binguoOrderVO,SideBoard sideBoard,String [] cellNo);

    /**
     * 存餐操作对side_board_cells_detail和side_board_cells这两张表操作
     * @param boardCells
     * @param saveOrderForm
     * @param binguoOrderVO
     * @param sideBoard
     * @param cellNo
     * @return
     */
    ErrorCode saveOrderUpdateRecord(SideBoardCells boardCells, SaveOrderForm saveOrderForm,BinguoOrderVO binguoOrderVO,SideBoard sideBoard,String [] cellNo);

    /**
     * 取餐操作对side_board_cells_detail和side_board_cells这两张表操作
     * @param list
     * @param cellNo
     * @param sideBoard
     * @param slist
     * @return
     */
    ErrorCode getOrderUpdateRecord(BinguoOrderVO binguoOrderVO,List<SideBoardCellDetail> list,String [] cellNo,SideBoard sideBoard,List<SideBoardCells> slist,Integer status,SaveOrderForm saveOrderForm);

    /**
     * 获取商户订单详情页订单状态
     * @param orderId
     * @return
     */
    ErrorCode getShopOrderStatus(String orderId);

    /**
     *
     * @param id
     * @return
     */
    List<SideBoardCells> selectAllSideBoardCell(Integer id);

    /**
     *
     * @param branchId
     * @param shopId
     * @return
     */
    List<SideBoard> getBranchSideBoard(Integer branchId,Integer shopId);

    /**
     *
     * @param shopId
     * @return
     */
    List<SideBoard> getShopSideBoard(Integer shopId);

    /**
     *
     * @param cells
     * @param id
     * @return
     */
    ErrorCode openCellsByCellNo(String cells,Integer id);

    /**
     *  效验取餐码是否有效
     * @param mealCode
     * @return
     */
    ErrorCode isTrueCode(String mealCode);

    /**
     * 微信小程序二维码取餐
     * @param saveOrderForm
     * @return
     */
    ErrorCode getOrderByCustomerCode(SaveOrderForm saveOrderForm);

    ErrorCode openByCustomerCodeOrCardUpdateRecord(List<OpenCellByCardNoVO> list,SideBoard sideBoard,String[] cellNo);

    /**
     * 刷卡取餐
     * @param saveOrderForm
     * @return
     */
    ErrorCode getOrderByPayCard(SaveOrderForm saveOrderForm);

    ErrorCode readyOpenCell(Integer customerId,Integer cashierDeskId);

    ErrorCode getOrderByFace(SaveOrderForm saveOrderForm);

    ErrorCode saveOrderByPhone(PhoneMealsForm phoneMealsForm);

    ErrorCode checkOrderPayStatus(SaveOrderForm saveOrderForm);

    ErrorCode getPayCode(SaveOrderForm saveOrderForm);

    ErrorCode beforeOpenCell(SaveOrderForm saveOrderForm) throws Exception;

    ErrorCode getBaiduSdkSerier(String deviceId);

    ErrorCode getSideBoardInitStatus(String deviceId);

    ErrorCode updateJPushRegisterId(SideBoardVO sideBoardVO);

    ErrorCode addSunSideBoard(SideBoardVO sideBoardVO);

    ErrorCode getSunSideBoard(SideBoardVO sideBoardVO);

    ErrorCode deleteSunSideBoard(SideBoardVO sideBoardVO);

    ErrorCode generateMiniProgramCode(String cashierDeskId);

    ErrorCode getSideBoardByCashierDeskId(Integer cashierDeskId);

    ErrorCode getCustomerMealCode(Integer branchId,Integer shopId,Integer customerId);

    ErrorCode saveOrderByPhoneForJY(PhoneMealsForm phoneMealsForm) throws Exception;

    ErrorCode saveOrderByPhoneSaveMeals(SaveOrderForm saveOrderForm, SideBoardVO sideBoardVO, ZSDOrderInfoForm zsdOrderInfoForm) throws Exception;

    ErrorCode updateSideBoard(Integer id,String sideBoardName);

    ErrorCode saveOrderByZSDQrCode(SaveOrderForm saveOrderForm) throws Exception;

    ErrorCode getOrderByZSDQrCode(SaveOrderForm saveOrderForm) throws Exception;

    /**
     * 获取订单id
     * @param mealCode 取餐码
     * @param shopId 商户Id
     * @param branchId 分店id
     * @return String
     */
    List<String> getBinguoOrderIdByMealCodes(String[] mealCode,Integer shopId,Integer branchId);

    /**
     * 上帝模式开柜并更新记录
     * @param cells
     * @param id
     * @return
     */
    ErrorCode openCellsByCellNoAndUpdateRecode(String cells,Integer id);

    Boolean sendWXGongZhoneMessage(String openId,String host,ZSDWXGongZhongMessageForm zsdwxGongZhongMessageForm)throws Exception;

    ErrorCode saveOrderUpdateRecordReturnCellNo(SideBoardCells boardCells, SaveOrderForm saveOrderForm, BinguoOrderVO binguoOrderVO, SideBoard sideBoard, String[] cellNo,BinguoOrder binguoOrder);

    ErrorCode getOrderUpdateRecordReturnCode(BinguoOrderVO binguoOrderVO, List<SideBoardCellDetail> list, String[] cellNo, SideBoard sideBoard, List<SideBoardCells> slist,Integer status,SaveOrderForm saveOrderForm);

    ErrorCode getAllCustomerBoard(Integer branchId,Integer cashierDeskId);

    ErrorCode bindCustomerBoard(BindCustomerBoardForm form);

    ErrorCode hendaGetOrder(SaveOrderForm saveOrderForm);

    ErrorCode hendaSaveOrder(SaveOrderForm saveOrderForm) throws Exception;

    ErrorCode saveOrderByHdSaveMeals(SaveOrderForm saveOrderForm,SideBoard sideBoard);

    ErrorCode getMealCodeByOrderUrl(SaveOrderForm saveOrderForm) throws ParseException;

    ErrorCode saveOrderByZSDQrCodeOrMealCode(SaveOrderForm saveOrderForm);

    ErrorCode saveOrderByZSDQrCodeOrMealCodeUpdateData(SaveOrderForm saveOrderForm, ThirdOrderData thirdOrderData, ZSDOrderInfoForm zsdOrderInfoForm);

    ErrorCode saveOrderByChooseCellNo(SaveOrderForm saveOrderForm);
}
